import React, { useState } from 'react'

function App1() {
    const [input, setInput] = useState([4, 4, 1, 1, 1, 2, 2, 2, 2, 3])
    const getData = (arr) => {
        return [...new Set(arr)].sort((a,b) => a - b)
    }
    const list = getData(input)
    return (
        <div>
            <h3>{input}</h3>
            <p>去重:{JSON.stringify(list)}</p>
        </div>
    )
}

export default App1
